/*
 * @Author: KKKKKK
 * @Date: 2021-01-10 12:08:53
 * @LastEditors: KKKKKK
 * @LastEditTime: 2021-01-10 12:08:54
 */
import axios from './config'
import url from './url'
const baseUrl = process.env.VUE_APP_BASE_URL


// 角色管理
// 新增角色
const roleCreate= (params) => axios.post(baseUrl + url.role.create, params)

// 删除多个角色
const roleDelete = (id) => axios.delete(baseUrl + url.role.deletes + `/${id}`)

// 根据id删除角色
const roleDeleteInfo = (id) => axios.delete(baseUrl + url.role.deleteInfo + `/${id}`)

// 修改角色
const roleUpdate = (params, id) => axios.post(baseUrl + url.role.update + `/${id}`, params)

// 获取某个角色
const roleLoad = (id) => axios.get(baseUrl + url.role.load + `/${id}`)

// 获取角色列表
const rolePage = (params) => axios.get(baseUrl + url.role.page, { params })

// 获取角色树
const getRoleTree= (params) => axios.get(baseUrl + url.role.tree, params)

export default {
  roleCreate,
  roleDelete,
  roleDeleteInfo,
  roleUpdate,
  roleLoad,
  rolePage,
  getRoleTree
}
